import { MockMethod } from 'vite-plugin-mock';
import { resultPageSuccess, resultSuccess } from '../_util';

const demoList = (() => {
  const result: any[] = [];
  for (let index = 0; index < 60; index++) {
    result.push({
      id: `${index}`,
      'requestsMethod_dictText|1': ['临时领取', '入职领取', '耗材领取'],
      returnTime: '@date',
      userId_dictText: '@cname',
      'departmentId_dictText|1': ['业务部', '销售部', '综合部', '技术部'],
      collectionPositionId: '@city()',
      description: '@ctitle',
      'requestsStatus|1': ['拒绝', '未处理', '通过', '作废'],
      assetList: [],
      'requestsMethod|1': ['1', '2', '3'],
      userId: 'zhangsan',

      departmentId: '4f1765520d6346f9bd9c79e2479e5b12',
    });
  }
  return result;
})();

enum Api {
  list = '/use_and_return/useAndReturn/list',
  save = '/use_and_return/useAndReturn/add',
  edit = '/use_and_return/useAndReturn/edit',
  deleteOne = '/use_and_return/useAndReturn/delete',
  deleteBatch = '/use_and_return/useAndReturn/deleteBatch',
}

const prefix = '/jeecgboot';
export default [
  // {
  //   url: prefix + Api.list,
  //   timeout: 1000,
  //   method: 'get',
  //   response: ({ query }) => {
  //     const { page = 1, pageSize = 20 } = query;
  //     return resultPageSuccess(page, pageSize, demoList);
  //   },
  // },
  // {
  //   url: prefix + Api.save,
  //   timeout: 1000,
  //   method: 'post',
  //   response: () => {
  //     return resultSuccess('ok');
  //   },
  // },
  // {
  //   url: prefix + Api.edit,
  //   timeout: 1000,
  //   method: 'post',
  //   response: () => {
  //     return resultSuccess('ok');
  //   },
  // },
  // {
  //   url: prefix + Api.deleteOne,
  //   timeout: 1000,
  //   method: 'delete',
  //   response: () => {
  //     return resultSuccess('ok');
  //   },
  // },
] as MockMethod[];
